/*
 * Created on 2005-5-8 @author wangzhiguo Description:
 */
package com.hd123.rumba.runtime;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @deprecated 被com.hd123.rumba.runtime.backprocess.TaskMgr及其相关类替代。
 * @author caili
 *
 */
public class TaskMgr {
  private static TaskMgr instance = null;

  private TaskMgr() {
    super();
  }

  public static TaskMgr getInstance() {
    if (instance == null)
      instance = new TaskMgr();
    return instance;
  }

  public Map taskMap = Collections.synchronizedMap(new HashMap());

  public Task createTask(String name, Class executeClass) {
    Task task = new Task(name, executeClass);
    taskMap.put(name, task);
    return task;
  }

  public Task getTaskByName(String name) {
    return (Task) taskMap.get(name);
  }

  public void removeTask(String name) {
    taskMap.remove(name);
  }

}
